<template>
    <div class="container" :style="{minHeight:screenHeight}">

      <div class="userHeader">
        <div class="userIcon"><img :src="userInfo.avatarUrl"></div>
        <div class="userName">
          <p>{{ userInfo.userName }}</p>
          <p>能量总和：{{ userInfo.totalSignCount }}</p>
        </div>
      </div>
      <div class="mine-item">
        <navigator url="../personaldata/main" hover-class="none">
          <div class="mine-item-box">
            <p>基本资料</p>
            <img src="../../../static/image/arrows.png" class="retuen-icon">
          </div>
        </navigator>
        <navigator url="../rankingRecord/main">
          <div class="mine-item-box">
            <p>签卡记录</p>
            <img src="../../../static/image/arrows.png" class="retuen-icon">
          </div>
        </navigator>
      </div>
    </div>
</template>
<script>
    export default {
        data(){
            return {
              userInfo:'',   //用户基本信息
              screenHeight: (Number(wx.getSystemInfoSync().windowHeight) - 49) + 'px',  //屏幕可用区域高度
            }
        },
      mounted(){
        //获取用户的基本信息
//        this.userInfo = wx.getStorageSync('userInfo');
        this.$httpWX.post({
          url: '/sign/getSelfSign',
          data: {}
        }).then(res => {
          if(res.code == 0){
            this.userInfo =  res.data;
          }
        });

      }
    }
</script>

<style>
  .container{
    width: 100%;
    background-color: #F7F7F7;
    position: relative;
    box-sizing: border-box;
    overflow: hidden;
  }
  .userHeader{
    width: 100%;
    height: 188rpx;
    border-top: 1rpx solid #EEEEEE;
    display: flex;
    align-items: center;
    background-color: white;
  }
  .userIcon{
    width: 140rpx;
    height: 140rpx;
    margin-left: 40rpx;
    margin-right: 30rpx;
    border-radius: 50%;
    overflow: hidden;
  }
  .userIcon>img{
    width: 100%;
    height: 100%;
  }
  .userName{
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .userName>p:nth-of-type(1){
    color: #282828;
    font-size: 28rpx;
    font-weight: 500;
  }
  .userName>p:nth-of-type(2){
    color: #282828;
    font-size: 24rpx;
    margin-top: 18rpx;
  }


  /*盒子部分*/
  .mine-item{
    width: 100%;
    margin-top: 20rpx;
  }
  .mine-item-box{
    width: 100%;
    height: 105rpx;
    border-bottom: 1rpx solid #EEEEEE;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0 34rpx 0 39rpx;
    background-color: white;
  }
  .mine-item-box p{
    color: #282828;
    font-size: 28rpx;
    font-weight: 400;
  }
  .retuen-icon{
    width: 14rpx;
    height: 24rpx;
  }
</style>
